package o;

import android.graphics.Rect;
import android.view.ViewGroup;
import androidx.transition.Transition;

public class mx extends ol {
    private float ˏ = 3.0f;

    public long ˏ(ViewGroup viewGroup, Transition transition, nx nxVar, nx nxVar2) {
        if (nxVar == null && nxVar2 == null) {
            return 0;
        }
        int i;
        int centerX;
        int centerY;
        if (nxVar2 == null || ॱ(nxVar) == 0) {
            i = -1;
            nxVar2 = nxVar;
        } else {
            i = 1;
        }
        int ˋ = ˋ(nxVar2);
        int ˎ = ˎ(nxVar2);
        Rect ˊॱ = transition.ˊॱ();
        if (ˊॱ != null) {
            centerX = ˊॱ.centerX();
            centerY = ˊॱ.centerY();
        } else {
            int[] iArr = new int[2];
            viewGroup.getLocationOnScreen(iArr);
            centerX = Math.round(((float) (iArr[0] + (viewGroup.getWidth() / 2))) + viewGroup.getTranslationX());
            centerY = Math.round(((float) (iArr[1] + (viewGroup.getHeight() / 2))) + viewGroup.getTranslationY());
        }
        float ˊ = ˊ((float) ˋ, (float) ˎ, (float) centerX, (float) centerY) / ˊ(0.0f, 0.0f, (float) viewGroup.getWidth(), (float) viewGroup.getHeight());
        long ॱ = transition.ॱ();
        if (ॱ < 0) {
            ॱ = 300;
        }
        return (long) Math.round((((float) (ॱ * ((long) i))) / this.ˏ) * ˊ);
    }

    private static float ˊ(float f, float f2, float f3, float f4) {
        float f5 = f3 - f;
        float f6 = f4 - f2;
        return (float) Math.sqrt((double) ((f5 * f5) + (f6 * f6)));
    }
}
